#!/bin/sh
cd simpleCodingQuiz-submit-${BUILD_NUMBER}

sudo docker exec -i $JOB_NAME-$BUILD_NUMBER /bin/sh -c "cd /var/${JOB_NAME}_${BUILD_NUMBER}/ && ./gradlew -x test sonarqube && cat build/sonar/report-task.txt"
sudo docker exec -i $JOB_NAME-$BUILD_NUMBER /bin/sh -c "cd /var/${JOB_NAME}_${BUILD_NUMBER}/ && cat build/sonar/report-task.txt" 1 >> report-task-${BUILD_NUMBER}
cat report-task-${BUILD_NUMBER} >> $messagePath/message-${BUILD_NUMBER}

str=$(cat report-task-${BUILD_NUMBER} |  sed -n '4p')
echo '代码质量检测报告:'+ ${str#*=} >> $messagePath/message-${BUILD_NUMBER}
#echo ${str#*=} >> $messagePath/message-${BUILD_NUMBER}
